﻿using System;
using System.Collections;
using System.Collections.Specialized;
using System.Data;
using System.Configuration;
using System.Data.Common;
using MySql.Data.MySqlClient;
using MySql.Data.Types;


namespace Qianwei.Dac
{
    /// <summary>
    /// NoSortHashTable
    /// </summary>
    public class NoSortHashTable : Hashtable
    {
        private ArrayList keys = new ArrayList();
        public NoSortHashTable()
        {

        }
        public override void Add(object key, object value)
        {
            base.Add(key, value);
            keys.Add(key);
        }
        public override ICollection  Keys
        {
            get
            {
                return keys;
            }
        }
      

        public override void Clear()
        {
            base.Clear();
            keys.Clear();
        }
        public override void Remove(object key)
        {
            base.Remove(key);
            keys.Remove(key);
        }
        public override IDictionaryEnumerator GetEnumerator()
        {
            return base.GetEnumerator();
        }
        public override bool ContainsKey(object key)
        {
            for (int i = 0; i < keys.Count; i++)
            {
                if (((MySqlParameter[])key).Rank ==1)
                {
                    if (((MySqlParameter[])key)[1].Value.ToString() == ((MySqlParameter[])keys[i])[1].Value.ToString())
                    {
                        return true;
                    }
                }
            }
            return false;
        }
        
    }
}
